<template>
	<div>
		<h2>我的分数表</h2>
		<hr>
		<table border="1px">
			<tr>
				<th>学生编号</th>
				<th>学生姓名</th>
				<th>班级编号</th>
				<th>班级名称</th>
				<th>课程编号</th>
				<th>课程名称</th>
				<th>课程成绩</th>
				<th>录入时间</th>
			</tr>
			<tr v-for="x in data.mark">
				<th>{{x.user.uid}}</th>
				<th>{{x.user.uname}}</th>
				<th>{{x.user.clz.clzno}}</th>
				<th>{{x.user.clz.clzname}}</th>
				<th>{{x.course.cno}}</th>
				<th>{{x.course.cname}}</th>
				<th>{{x.score}}</th>
				<th>{{mytpost(x.tpost)}}</th>
			</tr>
		</table>
	</div>
</template>

<script setup>
			import {ref, reactive,onMounted,computed} from"vue"
			import {$get,$postx,$postj,$postf} from '../../ajax/index.js'
			// import alert from '../../utils/doalert.js'
		const data=reactive({
			mark:[]
		})
	onMounted(()=>{
		$get("/api/fore/stu/findMyMark").then((reap)=>{
			data.mark=reap.data.data
			console.log(reap.data.data)
		})
		
	})
	const mytpost=computed(()=>{
		return function(tpost){
			console.log(tpost)
				let t=new Date(tpost)
				let yy=t.getFullYear()
				let mm=t.getMonth()+1
				let dd=t.getDate()
				let a=yy+"年"+mm+"月"+dd+"日"
				console.log(a)
				return a
		}
	})
</script>